import fetch from '../../utils/request';

export async function addExcelEle(params) { // 添加excel输入输出组件
    return fetch({url: '/api/excel/addEle', method: 'get', params})
}

export async function downloadExcelFile(params) { // 下载输出的excel文件
    return fetch({url: '/api/excel/downloadFile', method: 'get', responseType: 'blob', params})
}

export async function getAllExcelFieldNames(params) { // 获取指定sheet下的所有字段名
    return fetch({url: '/api/excel/getALlFieldNames', method: 'get', params})
}

export async function getAllExcelSheetNames(params) { // 获取上传excel的所有sheet名
    return fetch({url: '/api/excel/getAllSheetNames', method: 'get', params})
}

export async function uploadExcelFileAndEdit(params) { // 编辑上传的excel文件
    return fetch({url: '/api/excel/uploadFileAndEdit', method: 'put', params})
}

export async function uploadExcelFileAndSave(params) { // 上传要读取的excel文件
    return fetch({url: '/api/excel/uploadFileAndSave', method: 'post', params})
}

export async function addCsvEle(params) { // 添加csv输入输出组件
    return fetch({url: '/api/csv/addEle', method: 'get', params})
}

export async function downloadCsvFile(params) { // 下载输出的csv文件
    return fetch({url: '/api/csv/downloadFile', method: 'get', params})
}

export async function getAllCsvFields(params) { // 获取已上传文件的所有字段名
    return fetch({url: '/api/csv/getAllFields', method: 'get', params})
}

export async function uploadCsvFileAndEdit(params) { // 编辑已上传的csv文件
    return fetch({url: '/api/csv/uploadFileAndEdit', method: 'put', params})
}

export async function uploadCsvFileAndSave(params) { // 上传要读取的csv文件
    return fetch({url: '/api/csv/uploadFileAndSave', method: 'post', params})
}

